//
//  LearningStretchableCell.m
//  HotWord
//
//  Created by Ji Qi on 12-6-11.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "LearningStretchableCell.h"

@implementation LearningStretchableCell
@synthesize cellView;
@synthesize textLabel;
@synthesize  content;

//stretchableCell
- (void)awakeFromNib{
    cellView.image = [cellView.image resizableImageWithCapInsets:UIEdgeInsetsMake(20, 20, 20, 20)];
}


- (void)setContentForCell:(NSString *)aContent
{
    self.content = aContent;
    self.textLabel.height = [self.content sizeWithFont:self.textLabel.font constrainedToSize:CGSizeMake(180, 500) lineBreakMode:UILineBreakModeWordWrap].height;
    self.textLabel.text = self.content;
    cellView.height = self.textLabel.height + 30;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc{
    [content release];
    [cellView release];
    [textLabel release];
    [super dealloc];
}

@end
